package com.sdb.patientuser.controller;


import com.sdb.common.core.controller.BaseController;
import com.sdb.patientuser.domain.Patientuser;
import com.sdb.patientuser.service.PatientuserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/patientuser/info")
public class PatientuserController extends BaseController {

    @Autowired
    private PatientuserService patientuserService;


    /**
     * 绑定患者信息
     * @return
     */
    @RequestMapping("/bang")
    public int bang(@RequestBody Patientuser patientuser){
        return patientuserService.bang(patientuser);
    }

    /**
     * 获取患者信息
     * @return
     */
    @RequestMapping("/getbyuserid")
    public Patientuser getPatientInfo(){
        return patientuserService.getbyuserid();
    }

    /**
     * 修改患者信息
     */
    @PostMapping("/updatepatient")
    public int update(@RequestBody Patientuser patientuser){
        return patientuserService.updatepatient(patientuser);
    }
}
